package com.bilifuture.interceptor;

import com.bilifuture.statemachine.interceptor.StateMachineInterceptor;
import com.bilifuture.statemachine.machine.StateMachineContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author bilifuture
 * @description:
 * @date 2022-04-02
 */
@Slf4j
@Component("orderTransitionInterceptor")
public class OrderTransitionInterceptor implements StateMachineInterceptor {
    
    /**
     * 开始状态转换前执行
     *
     * @param context 上下文
     */
    @Override
    public void preTransition(StateMachineContext context) {
        log.info("OrderTransitionInterceptor -> preTransition");
    }
    
    /**
     * 状态转换执行后执行
     *
     * @param context 上下文
     */
    @Override
    public void postTransition(StateMachineContext context) {
        log.info("OrderTransitionInterceptor -> postTransition");
    }
}
